import pygame

def resize_image(input_path, output_path, target_size):
    # 加载原始图片
    original = pygame.image.load(input_path)
    # 调整大小
    resized = pygame.transform.scale(original, target_size)
    # 保存调整后的图片
    pygame.image.save(resized, output_path)

# 初始化 pygame
pygame.init()

# 获取 ship.bmp 的尺寸作为目标尺寸
ship = pygame.image.load('e:/xtldn/base_python/alieninvasion/images/alien2.bmp')
target_size = ship.get_rect().size

# 调整 alien.bmp 的尺寸
resize_image('e:/xtldn/base_python/alieninvasion/images/alien.bmp', 
            'e:/xtldn/base_python/alieninvasion/images/alien_resized.bmp', 
            target_size)

pygame.quit()